//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<CShaderAdapter9.h>
///	@path	~/src/graphics/dx9/
///	@date	2008/12/28
///	@desc	.

#pragma once

#include "xeres.h"

#include "graphics/IShaderAdapter.h"
#include "graphics/IEffect.h"
#include "graphics/ITechnique.h"

namespace xeres {

	/*! 
		\class	CShaderAdapter9
		\brief
	*/
	class CShaderAdapter9 : public IShaderAdapter
	{
	public:

		/// \ctor
		CShaderAdapter9( RefWeak<IShader> shader );

		/// \dtor
		virtual ~CShaderAdapter9( void );

		DECL_IOBJECT_CLASS( CShaderAdapter9 , IShaderAdapter );

	public:

		/// \name Shader Adapter Interface
		//@{

		/*! 
			\brief	Get adapted technique.
		*/
		virtual RefWeak<IShader> AdaptShader( RenderContext& rc );

		/*! 
			\brief	Assemble shader.
		*/
		virtual void AssembleShader( RenderContext& rc );

		/*! 
			\brief	Draw geometry with adapted shader.
		*/
		virtual void Draw( RenderContext& rc , RefWeak<IGeometry> geo );

		//@}

	private:

		//@ data
		Ref<IShader>		m_shader;
	};
	
} // namespace xeres
